package org.takinframework.web.buss.job;

import java.util.Date;

import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.takinframework.core.quartz.BaseJob;
import org.takinframework.core.util.DateUtils;
import org.takinframework.core.util.LogUtil;
import org.takinframework.web.system.service.SystemService;


/**
 * 粮仓定时任务
 * @author twg
 *
 */
public class DepotJob extends BaseJob {
	@Autowired
	private SystemService systemService;

	public void executeJob(JobExecutionContext context) throws JobExecutionException {
		try {
			JobDataMap dataMap = context.getJobDetail().getJobDataMap();
			JobKey jobKey = context.getJobDetail().getKey();
			LogUtil.info("任务名==【"+jobKey.getName()+"】任务组名==【"+jobKey.getGroup()+"】==时间=="+DateUtils.formatDateTime(new Date()));
			System.out.println("DepotJob.executeJob() : 任务名==【"+jobKey.getName()+"】任务组名==【"+jobKey.getGroup());
			//发指令开始
			
		} catch (Exception e) {
			LogUtil.error("调用DepotJob任务失败", e);
			JobExecutionException e2 = new JobExecutionException(e);
			e2.setRefireImmediately(true);
            throw e2;
		}
		
		
	}

}
